package br.com.klis.batendoumabola.server.util;

import com.google.appengine.api.images.Image;
import com.google.appengine.api.images.ImagesService;
import com.google.appengine.api.images.ImagesServiceFactory;
import com.google.appengine.api.images.Transform;

public class ImageUtil {
	
	public static byte[] resizeImage(byte[] conteudo, Integer width, Integer height){
    	ImagesService imagesService = ImagesServiceFactory.getImagesService();
		Image image = ImagesServiceFactory.makeImage(conteudo);
		Transform resize = ImagesServiceFactory.makeResize(width, height);
		image = imagesService.applyTransform(resize, image);
		return image.getImageData();
    }
}
